<!DOCTYPE html>
<html>
	<head> 
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" href="css/lib/bootstrap.min.css"/>
		<link rel="stylesheet" href="js/themes/default/easyui.css"/>
		<script src="js/lib/jquery-1.11.0.js"></script>
		<script src="js/lib/bootstrap.min.js"></script>	
		<script src="js/base.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<style>
		body{
			font-size:12px;
		}
		table,
		/* th,
		td {
			border: 1px solid grey;
			border-collapse: collapse;
			padding: 5px;
			vertical-align: middle !important;
		}		 */
		table td:nth-child(odd) {
			background-color: #f1f1f1;
			width:160px;
		}
		table td:nth-child(even) {
			width:300px;
		}
		table tr:nth-child(even) {
			background-color:#ffffff;
		}
		input{
			width:280px;
		}
		span{
			width:20px;color:red;display:inline-block;text-align:center;
		}
		#sho{
			width:300px;
			height:50px;
			background:#d9534f;
			opacity:0.8;
			border-radius:8px;
			color:#fff;
			text-align: center;
			font-size:30px;
			position: absolute;
			top:0px;
			left:550px;
			display:none;
		}
	</style>
	<body>		
	<!--实名认证-->
		<div class="">
			<div id="sho"></div>
		<div style="padding:15px 5px 0px 5px;border:3px solid #ccc;margin-bottom:15px">
			<table class="table table-hover">				
				<tbody>
					<tr>
						<th colspan="8" style="font-size:26px;color:#337ab7">实名认证:</th>
					</tr>
					<tr>
						<td>用户ID:</td>
						<td colspan="3">
							<input id="p3" class="form-control" type="text"  style="width:280px;"/>
							
						</td>								
					</tr>
					<tr>
						<td>姓名:</td>
						<td colspan="3">
							<input id="p1" class="form-control" type="text"  style="width:280px;"/>
						</td>								
					</tr>
					<tr>
						<td>身份证号码:</td>
						<td colspan="3">
							<input id="p2" class="form-control" type="text" style="width:280px;"/>
						</td>				
					</tr>
					<tr>						
						<td colspan="8">
							<button id="btn" class="btn btn-danger" style="margin:0 auto;display:block;">实名认证</button>
						</td>										
					</tr>
					
				</tbody>
			</table>		
		</div>
		<!-- <div style="padding:15px 5px 0px 5px;border:3px solid #ccc;margin-bottom:15px">
		<p>真实照片提交</p>
			<form action=window.baseUrl+"user/upload/realname" method="post" enctype="multipart/form-data">
			<input type="file"  name="image"/>
			<input type="file"  name="image"/>
			<input type="file"  name="image"/>
			<input type="hidden" name="token" id="token"/>		
			手机号码：<input class="form-control" type="text"  name="phone" id="phone" style="width:200px;"/>
			<input type="submit"  id="submit" value="提交照片" class="btn btn-danger"  style="width:150px;margin-top:18px"/>	
			</form>	
		</div> -->
		</div>
	</body>
	<script>
		$(function(){			
			/*实名认证接口*/
			$('#btn').click(function(){
				var token = sessionStorage.getItem(key=1)
				var p1 = $("#p1").val();
				var p2 = $("#p2").val();
				var p3 = $('#p3').val();
				console.log(p2)
				if(p1!="" && p2!=""){
					$.ajax({
							type:"POST",
							url:window.baseUrl+"paymentchannel/realname/auth/backstage",
							async:true,
		        			data:{
		        				realname:p1,
		        				idcard:p2,
		        				userid:p3
		        			},
		        			dataType:"json",
		        			success:function(data){
		        				console.log("远程调用数据开始。。。")
		        				console.log(data)
		        				if(data.error_code == 0){
		        					$('#sho').text("实名认证成功").fadeIn(3000)
		        					$('#sho').text("实名认证成功").fadeOut(3000)	
		        					$("#p1").val("");
									$("#p2").val("");							
		        				}else{
		        					$('#sho').text("实名认证失败").fadeIn(3000)
		        					$('#sho').text("实名认证失败").fadeOut(3000)       						
		        				}      				
		        			},
		        			error:function(data){
		        				console.log("调用失败！")
		        				console.log(data)
		        				$("#p1").val("");
								$("#p2").val("");	
		        			}
					})
				}else{
					alert("请完善输入信息！")
				}
				
			})
		})
	</script>
</html>



